-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Conversation
Remove botched ethcore-error crate
* master: Extricate PodAccount and state Account to own crates (#10838) logs (#10817) refactor: whisper: Add type aliases and update rustdocs in message.rs (#10812) Break circular dependency between Client and Engine (part 1) (#10833) tests: Relates to #10655: Test instructions for Readme (#10835) refactor: Related #9459 - evmbin: replace untyped json! macro with fully typed serde serialization using Rust structs (#10657)
…hore/extricate-state-backend * dp/chore/extricate-account-db-into-own-crate: third time's the charm test failure 2 test failure Extricate PodAccount and state Account to own crates (#10838) logs (#10817) refactor: whisper: Add type aliases and update rustdocs in message.rs (#10812) Break circular dependency between Client and Engine (part 1) (#10833) tests: Relates to #10655: Test instructions for Readme (#10835) refactor: Related #9459 - evmbin: replace untyped json! macro with fully typed serde serialization using Rust structs (#10657)
* master: Improve logging and cleanup in miner around block sealing (#10745)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great PR! I have only a few questions about the code. I believe that those changes are very needed and are a huge step towards getting ethcore more modular
* master: EIP-1702: Generalized Account Versioning Scheme (#10771)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, definitely a good step forward.
ethcore-blockchain = { path = "../blockchain" } | ||
ethcore-db = { path = "../db" } | ||
ethereum-types = "0.6" | ||
evm = { path = "../evm" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again requiring entire EVM seems odd, would be worth to remove it in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use CallType
from the evm
, that's all. Seems like a good opportunity for a refactor indeed.
|
||
[dependencies] | ||
common-types = { path = "../types"} | ||
ethcore-blockchain = { path = "../blockchain" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need the entire blockchain or just some trait definitions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently we use BlockChainDB
and the contentious DatabaseExtras
, e.g.:
pub struct TraceDB<T> where T: DatabaseExtras {
/// cache
traces: RwLock<HashMap<H256, FlatBlockTraces>>,
/// hashes of cached traces
cache_manager: RwLock<CacheManager<H256>>,
/// db
db: Arc<dyn BlockChainDB>,
/// tracing enabled
enabled: bool,
/// extras
extras: Arc<T>,
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is your thinking here? Are you thinking we should move traits to a common-traits
crate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good. I think we should get it in asap and we can fix trace <-> blockchain relation later on
@@ -100,7 +108,7 @@ impl<'a> EvmTestClient<'a> { | |||
} | |||
|
|||
/// Change default function for dump state (default does not dump) | |||
pub fn set_dump_state_fn(&mut self, dump_state: fn(&state::State<state_db::StateDB>) -> Option<pod_state::PodState>) { | |||
pub fn set_dump_state(&mut self) { | |||
self.dump_state = dump_state; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this function looks a bit weird
@tomusdrw @debris Merging this but I'll make sure the following gets addressed in follow up PRs:
|
* master: Run cargo fix on a few of the worst offenders (#10854) removed redundant fork choice abstraction (#10849) Extract state-db from ethcore (#10858) Fix fork choice (#10837) Move more code into state-account (#10840) Remove compiler warning (#10865) [ethash] use static_assertions crate (#10860)
* master: Run cargo fix on a few of the worst offenders (#10854) removed redundant fork choice abstraction (#10849) Extract state-db from ethcore (#10858) Fix fork choice (#10837) Move more code into state-account (#10840) Remove compiler warning (#10865) [ethash] use static_assertions crate (#10860)
Moves
ethcore/state
into a newaccount-state
crate.State management has a piece that is tightly coupled to other
ethcore
modules, mainlyMachine
andExcutive
(and related types and support code).In order to extract the state management code from
ethcore
I have left one module –executive_state
– inethcore
that isolates the code where the state code is too entangled with the rest ofethcore
to be tackled at this time. The tests for state management are also still inethcore
because of the tight coupling with otherethcore
modules. While this is rather ungainly and unsatisfactory I think it's an improvement to have this code in an isolated unit that makes it obvious where the coupling takes place.The end result is that we now have 6k loc less in
ethcore
and the following new crates:trace
factories
account-state
pod
account-db
from Extract AccountDB to account-db #10839We also have a somewhat smaller API surface on
ethcore
.The diff is very noisy and for that I apologise. The only really new code is in
executive_state.rs
and the rest is mostly cleanup and munging. None of theTODO
s that show up as "green" are mine (but still worthy of consideration ofc). I have used this branch to sync Goerli.Builds on #10839